const {
  lnitFiles,
  getRefernces,
  rename
} = require('./index');

const util = require('./util');

const rootPath = util.searchPackageJSONDir();
const baseWebpackConfig = require('../../build/webpack.base.conf.js');
const jsPathAlias = baseWebpackConfig.resolve.alias;
const jsExtensions = baseWebpackConfig.resolve.extensions;

(async function () {
  /**
   * lint test
   */
  // let lintResult = await lnitFiles('src/**/*');
  // console.log(lintResult);

  /**
   * ref test
   */
  // let refResult = await getRefernces(`${rootPath}/src/**/*.vue`, {
  //   jsConfig: {
  //     pathAlias: jsPathAlias,
  //     extensions: jsExtensions
  //   }
  // });

  // console.log(refResult);

  /**
   * rename test
   */
  rename(
    '/Users/xiepeng/Documents/front-end/auto-code/src/Util.js',
    '/Users/xiepeng/Documents/front-end/auto-code/src/util.js',
    [ '/Users/xiepeng/Documents/front-end/auto-code/src/main.js' ],
    {
      jsConfig: {
        pathAlias: jsPathAlias,
        extensions: jsExtensions
      }
    }
  );
})();
